<?php
class MStatic extends CI_Model{

	public function __construct()
    {
        parent::__construct();
    }
    
    function getStatusDropdown($broken = true)
    {
        $data = array();
        if($broken)
           $Q = $this->db->get('status');
        else
            $Q = $this->db->get_where('status', array('status_id <>'=>3));
        
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['status_id']] = $row['status'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getFADropdown()
    {
        $data = array();
        $Q = $this->db->get('fatype');
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['fatype_id']] = $row['fatype'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getFADropdownSearch()
    {
        $data = array();
        $Q = $this->db->get('fatype');
        $data[''] = '...Search Type...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['fatype_id']] = $row['fatype'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getNADropdown()
    {
        $data = array();
        $Q = $this->db->get('natype');
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['natype_id']] = $row['natype'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getNADropdownSearch()
    {
        $data = array();
        $Q = $this->db->get('natype');
        $data[''] = '...Search Type...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['natype_id']] = $row['natype'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }

    function getTypeDropdown()
    {
        $data = array();
        $Q = $this->db->get('printtype');
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['type_id']] = $row['type'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getTypeDropdownSearch()
    {
        $data = array();
        $Q = $this->db->get('printtype');
        $data[''] = '...Search Type...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['type_id']] = $row['type'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getContractDropdown()
    {
        $data = array();
        $Q = $this->db->get('contracttype');
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['contracttype_id']] = $row['contracttype'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getITTypeDropdown()
    {
        $data = array();
        $Q = $this->db->get('ittype');
        $data[''] = '...Select category...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['ittype_id']] = $row['ittype'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getModelDropdown()
    {
        $data = array();
        $Q = $this->db->get('model');
        $data[''] = '...Select model...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['model_id']] = $row['model'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
            
    function getBranchDropdown()
    {
        $data = array();
        $this->db->where('activate', 1);
        $Q = $this->db->get('branch'); 
        $data[''] = '...Select office...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['branch_id']] = $row['branch'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
    
    function getLocationDropdown()
    {
        $data = array();
        $Q = $this->db->get('location'); 
        $data[''] = '...Select Location...';
	    if ($Q->num_rows() > 0){
	       foreach ($Q->result_array() as $row){
	         $data[$row['location_id']] = $row['location'];
	       }
         }
         $Q->free_result();    
	     return $data; 	
    }
 }